package com.gjs.cd.mapper;

/**
 *  @author zhongwenguang
 *  @date 2022-3-10 10:04
 */

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gjs.cd.pojo.entity.Code;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CodeMapper extends BaseMapper<Code> {

    //实现批量插入激活码
    int insertCode(@Param("list") List<Code> list,@Param("tableName") String tableName);

    //查询
    Code queryByCode(@Param("tableName") String tableName,@Param("code")String code);

    //查询所有激活码表名称
    List<String> queryTable();

    //通过codeId获取List<Code>,多表查询结果合并
    List<Code> queryByTableNames(@Param("tableNameList") List<String> tableNameList,@Param("ids") List<Long> ids);

    //通过activation_code_id批量查询
    List<Code> queryCodeList(@Param("tableName") String tableName,@Param("ids") List<Long> ids);

}
